package Code.Test4;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        //nextint(); 接收整数
        //nextDouble; 接收小数
        //next; 接收字符串
        //遇到空格、制表符、回车就停止接收
        /*Scanner scanner =new Scanner(System.in);
        System.out.println("输入一个整数");
        int number = scanner.nextInt();
        System.out.println(number);
        System.out.println("输入一个整数");
        int number2 = scanner.nextInt();
        System.out.println(number2);

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String s1 = scanner.next();
        System.out.println(s1);
        System.out.println("请输入一个字符串：");
        String s2 = scanner.next();
        System.out.println(s2);*/


        //nextLine(); 接收字符串
        //可以接收空格、制表符
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入一个字符串：");
        String s1 = scanner.nextLine();
        System.out.println(s1);
        System.out.println("输入一个字符串：");
        String s2 = scanner.nextLine();
        System.out.println(s2);

         //nextLine和其他的next不能混用


    }
}
